/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package ws;

import com.google.gson.Gson;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.UriInfo;

/**
 * REST Web Service
 *
 * @author Aluno
 */
@Path("BemEstar")
public class BemEstar {

    @Context
    private UriInfo context;

    /**
     * Creates a new instance of BemEstarWS
     */
    public BemEstar() {
    }

    /**
     * Retrieves representation of an instance of ws.BemEstarWS
     * @return an instance of java.lang.String
     */
    @GET
    @Produces("application/json")
    @Path("DicaDia")
    public String DicaDia() {
        Gson g = new Gson();
        String dica = "Beber dois litros de água por dia";
        return g.toJson(dica);
    }

   
    @GET
    @Produces("application/json")
    @Path("IMC/{altura}/{peso}")
    public String IMC(@PathParam("altura") Double altura, @PathParam("peso") Double peso){
        
        Gson g = new Gson();
        Double imc =peso / (altura * altura);
        return g.toJson(imc);
    
}
    /**
     * PUT method for updating or creating an instance of BemEstarWS
     * @param content representation for the resource
     * @return an HTTP response with content of the updated or created resource.
     */
    @PUT
    @Consumes("application/json")
    public void putJson(String content) {
    }
}
